/*
 * @Author: your name
 * @Date: 2021-10-20 09:29:14
 * @LastEditTime: 2021-10-22 11:23:18
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \Vuec:\Users\86131\Desktop\project\payforknowledge\src\store\shopcar\index.js
 */
import { shopCarApi } from "../../utils/api";

const shopCarModule = {
  state: {
    shopList: [],
  },

  mutations: {
    changeShop(state, payload) {
      state.shopList = payload.result;
    },
  },
  actions: {
    async getShopList({ commit }, payload) {
      const res = await shopCarApi({
        token: payload.token,
      });
      commit("changeShop", res);
    },
  },
};

export default shopCarModule;
